home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Examples
/
More Examples
/
Using MIDI controllers
< prev
next >
Wrap
Text File
|
1998-10-26
|
1KB
|
45 lines
>Say for instance I wanted to generate a sine wave that had 1024
>samples, scrolled through all 128 MIDI values, and lasted exacted one
>messure of 4/4 timing. How would I accmplish that?
First define instrument synth that has both the melodic and controller
components.
(def-orchestra 'orchestra
all-instruments (synth)
synth (synth_mel synth_cnt)
)
Then define the values for both components, and then define the values
for the components which differ. The _mel component has a symbol content
and length content and _cnt has a different length content and controller.
To calculate the number of samples needed use get-ratio. Note that the rate
that you send controllers is determined by the _cnt length. Use the same
value in the get-ratio to calculate the number of samples.
(def-section sect-a
synth
zone '(4/1)
tonality (activate-tonality (major c 4))
velocity '(64)
channel '(1)
symbol '(=)
synth_mel
length '(1/16)
symbol '(a b c)
synth_cnt
length '(1/32)
controller (mu80-controllers
volume (list (gen-cresc 0 127 (/ (get-ratio '4/1 :ratio)
(get-ratio '1/32 :ratio)))))
)
(def-tempo 120)
(midiport :printer)
(play-file-p "controllers"
all-instruments '(sect-a)
)